package com.example.最多可以派出多少团队;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @Author: 唐佳辉
 * @CreateTime： 2024-06-06-上午10:35
 * @Description:
 * @Version：
 * 1.0
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = scanner.nextInt();
        }
        int m = scanner.nextInt();

        Arrays.sort(nums);

        if (nums[0] >= m) {
            System.out.println(n);
        } else {
            int left = 0, right = n - 1;
            int ans = 0;

            while (left < right) {
                if (nums[right] >= m) {
                    right--;
                    ans++;
                } else if (nums[right] + nums[left] >= m) {
                    left++;
                    right--;
                    ans++;
                } else {
                    left++;
                }
            }

            System.out.println(ans);
        }
    }
}
